import request from '@/utils/request'
import axios from 'axios'

/**
 * 查询车辆数据列表
 * @param {*} query 
 * @returns 
 */
export function vehicleList(query) {
    return request({
        url: '/vehicle/list',
        method: 'get',
        params: query
    })
}

// 修改车辆品牌
export function updateVehicle(data) {
    return request({
      url: '/vehicle',
      method: 'put',
      data: data
    })
  }

/**
 * 数据同步接口
 * @returns 
 */
export function exportVehicle(query) {
    return request({
        url: '/vehicle/synchronization/start',
        method: 'get',
        params: query
    })
}

/**
 * 车辆图片List集合
 * @param {*} query 
 * @returns 
 */
export function ListImg(query) {
    return request({
        url: '/vehicle/img/list',
        method: 'get',
        params: query
    })
}


/**
 * 新增车辆图片管理
 * @param {*} data 
 * @returns 
 */
export function addImg(data) {
    return request({
        url: '/vehicle/img',
        method: 'post',
        data: data
    })
}

// 修改车辆图片管理
export function updateImg(data) {
    return request({
        url: '/vehicle/img',
        method: 'put',
        data: data
    })
}
// 删除车辆图片管理
export function deleteImg(id) {
    return request({
        url: '/vehicle/img/'+id,
        method: 'delete'
    })
}

// 查询车辆车型详细
export function getInfo(id) {
    return request({
        url: 'vehicle/img/' + id,
        method: 'get'
    })
}

export function getVehicle(query) {
    return request({
        url: '/vehicle/inquiryVehicle',
        method: 'get',
        params: query
    })
}

export function getVehicleInfo(vehicleId) {
    return request({
        url: '/vehicle/' + vehicleId,
        method: 'get'
    })
}

// 删除车辆车型
export function delVehicle(vehicleIds) {
    return request({
      url: '/vehicle/' + vehicleIds,
      method: 'delete'
    })
  }

export function detachVehicle(query) {
    return request({
        url: '/vehicle/detach',
        method: 'get',
        params: query
    })
}


export function bindVehicle(query) {
    return request({
        url: '/vehicle/bind',
        method: 'get',
        params: query
    })
}